package com.steakliu.sun.common.util;

import com.steakliu.sun.annotation.SunService;
import org.apache.commons.lang3.StringUtils;

/**
 * 功能说明：
 * <p>
 * Original @Author: steakliu-刘牌, 2023-01-14  13:34
 * <p>
 * Copyright (C)2020-2022  steakliu All rights reserved.
 */
public class ServiceUtil {

    public static String getServiceName(SunService sunService) {
        Class<?> interfaceClass = sunService.interfaceClass();
        if (void.class != interfaceClass) {
            return interfaceClass.getName();
        }
        String interfaceClassName = sunService.interfaceClassName();
        if (StringUtils.isNotEmpty(interfaceClassName)) {
            return interfaceClassName;
        }
        return null;
    }
}
